/*    */ package com.newcrm.webapi;
/*    */ 
/*    */ import com.newcrm.util.Util;
/*    */ import java.io.FileInputStream;
/*    */ import java.io.IOException;
/*    */ import java.util.Properties;
/*    */ import javax.servlet.ServletConfig;
/*    */ import javax.servlet.ServletContext;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServlet;
/*    */ import org.apache.log4j.PropertyConfigurator;
/*    */ 
/*    */ public class Log4jInit extends HttpServlet
/*    */ {
/*    */   private static final long serialVersionUID = -7531239308771972853L;
/*    */ 
/*    */   public void init(ServletConfig config)
/*    */     throws ServletException
/*    */   {
    //把系统部署地址信息发送到企客保官方，注释掉
///* 28 */     String ipAddress = Util.getLocalIPAddress();
///* 29 */     if ((ipAddress != null) && (ipAddress.trim().length() > 0)) {
///* 30 */       ReportLocalInfoManager.getInstance().report(ipAddress, 80,
///* 31 */         config.getServletContext().getContextPath());
///*    */     }
/*    */ 
/* 34 */     String prefix = config.getServletContext().getRealPath("/");
/* 35 */     String file = config.getInitParameter("log4j");
/* 36 */     String filePath = prefix + file;
/* 37 */     Properties props = new Properties();
/* 38 */     FileInputStream istream = null;
/*    */     try {
/* 40 */       istream = new FileInputStream(filePath);
/* 41 */       props.load(istream);
/* 42 */       String logFile = prefix + 
/* 43 */         props.getProperty("log4j.appender.R.File");
/* 44 */       props.setProperty("log4j.appender.R.File", logFile);
/* 45 */       PropertyConfigurator.configure(props);
/*    */     }
/*    */     catch (IOException localIOException) {
/* 48 */       if (istream != null)
/*    */         try {
/* 50 */           istream.close();
/*    */         }
/*    */         catch (IOException localIOException1)
/*    */         {
/*    */         }
/*    */     }
/*    */     finally
/*    */     {
/* 48 */       if (istream != null)
/*    */         try {
/* 50 */           istream.close();
/*    */         }
/*    */         catch (IOException localIOException2)
/*    */         {
/*    */         }
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.Log4jInit
 * JD-Core Version:    0.6.1
 */